<?php

namespace App\Models;


use App\Http\Traits\GlobalConstant;

class DragDetail extends Orm
{
    protected $table = 'dragon_detail';
    protected $dateFormat = 'U';
    public $timestamps = true;

    public $casts = [
        'pics' => 'json',
    ];

    public function getPriceAttribute($value)
    {
        return GlobalConstant::formatNumber($value);
    }

    public function DragonInfo()
    {
        return $this->belongsTo(Drag::class, 'drag_id');
    }

    public function setPriceAttribute($value)
    {
        $this->attributes['price']=str_replace(',','',$value);
    }
}
